local skill = fk.CreateSkill({
  name = "yz__tanyan", 
  tags = {Skill.Compulsory,Skill.Limited}, -- 技能标签，Skill.Compulsory代表锁定技，支持存放多个标签
})


skill:addEffect(fk.DamageCaused, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skill.name) and player:usedSkillTimes(skill.name, Player.HistoryGame) == 0 and
      table.every(player.room:getOtherPlayers(player, false), function(p)
        return player:getHandcardNum() > p:getHandcardNum()
      end)
  end,
  on_use = function(self, event, target, player, data)
    data:changeDamage(1)
    local room = player.room
    local choices = {"#ask__tanyan1:"..player.id, "#ask__tanyan2:"..player.id, }
    local choice = room:askToChoice(target, {
      choices = choices,
      all_choices = choices,
      cancelable = false, --是否可取消
      detailed = false, --是否显示详细选项
      skill_name = skill.name,
    })
    if choice == "#ask__tanyan1:"..player.id then
      player:drawCards(2,skill.name)
      player:setSkillUseHistory(skill.name, 0, Player.HistoryGame)
    else
      room:recover{
        who = player,
        num = player.maxHp - player.hp,
        recoverBy = player,
        skillName = skill.name,
      }
    end
  end
})
skill:addEffect(fk.DamageInflicted, {
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skill.name) and player:usedSkillTimes(skill.name, Player.HistoryGame) == 0 and
      table.every(player.room:getOtherPlayers(player, false), function(p)
        return player:getHandcardNum() > p:getHandcardNum()
      end)
  end,
  on_use = function(self, event, target, player, data)
    data:changeDamage(1)
    local room = player.room
    local choices = {"#ask__tanyan1:"..player.id, "#ask__tanyan2:"..player.id, }
    local choice = room:askToChoice(target, {
      choices = choices,
      all_choices = choices,
      cancelable = false, --是否可取消
      detailed = false, --是否显示详细选项
      skill_name = skill.name,
    })
    if choice == "#ask__tanyan1:"..player.id then
      player:drawCards(2,skill.name)
      player:setSkillUseHistory(skill.name, 0, Player.HistoryGame)
    else
      room:recover{
        who = player,
        num = player.maxHp - player.hp,
        recoverBy = player,
        skillName = skill.name,
      }
    end
  end
})

Fk:loadTranslationTable {
["yz__tanyan"] = "贪餍",
[":yz__tanyan"] = "锁定技，限定技，当你造成或受到伤害时，若你手牌数为全场唯一最多，此伤害+1，然后你选择一项：1.摸两张牌并重置此技能；2.回复体力至体力上限。",
["$yz__tanyan1"] = "",
["$yz__tanyan2"] = "",
["#ask__tanyan1"] = "%src 摸两张牌并重置此技能",
["#ask__tanyan2"] = "%src 回复体力至体力上限",
}
return skill  --不要忘记返回做好的技能对象哦